<style>
.table>tbody>.td_first>td{ border-top:0px;}
</style>
<div class="page-content" >
            
    <div class="panel panel-default">
			 <div class="panel-heading">
          <ul class="breadcrumb">
				 
				<li><a href="<{:U('Questions/index',array('type'=>$type))}>"><{$title}></a> </li>
				<if condition="$piddata">
					<li ><{$piddata.question}></li>
				</if>
			</ul>
			</div>
        <div class="panel-body">
            <div class="span10" id="datacontent" >
			
			
			<form <if condition="$piddata">style="display:none"</if> action="<{:U('Questions/index')}>" method="get" >
				<table class="table">
					 
					<tbody><tr class="td_first">
						<td>
							试题ID：
						</td>
						<td>
						<input type="hidden"  name="type" value="<{$type}>" />
							<input name="questionid" class="input-small" size="25" type="text" value="<{$questionid}>" autocomplete="off">
						</td>
						<td>
							录入时间：
						</td>
						<td>
							<input class="input-small datetimepicker" data-date="" data-date-format="yyyy-mm-dd" type="text" name="stime" size="10" id="stime" value="<{$stime}>" autocomplete="off"> - <input class="input-small datetimepicker" data-date="" data-date-format="yyyy-mm-dd" size="10" type="text" name="etime" id="etime" value="<{$etime}>" autocomplete="off">
						</td>
						<td>
							关键字：
						</td>
						<td>
							<input class="input-small" name="kw"  size="25" type="text" value="<{$kw}>" autocomplete="off">
						</td>
					</tr>
			        <tr>
						<td>
							课程：
						</td>
						<td>
			        		<select name="questionsubjectid" class="combox input-medium" target="sectionselect" refurl="<{:U('Subject/get_ajax_section',array('type'=>'_sel'))}>?subjectid={value}" autocomplete="off">
				        		<option value="0">选择科目</option>
								  	<volist name="subject_list" id="vo">
						  			<option <if condition="$questionsubjectid eq $vo['subjectid']">selected="selected"</if>  value="<{$vo.subjectid}>"><{$vo.subject}></option>
									</volist>	
						  	</select>
			        	</td>
			        	<td>
							章节：
						</td>
						<td>
					  		<select name="questionsectionid" class="combox input-medium" id="sectionselect" target="knowsselect" refurl="<{:U('Subject/get_ajax_knows',array('type'=>'_sel'))}>?sectionid={value}" autocomplete="off">
					  		<option value="0">选择章节</option>
					  		</select>
			        	</td>
			        	<td>
							知识点：
						</td>
						<td>
					  		<select name="questionknowsid" id="knowsselect" class="input-medium" autocomplete="off">
						  		<option value="">选择知识点</option>
						  	</select>
			        	</td>
					</tr>
					<tr>
						<td>
							录入人：
						</td>
			        	<td>
			        		<input class="input-small" name="questionusername" size="25" type="text" value="<{$questionusername}>" autocomplete="off">
			        	</td>
			        	<td>
							试题类型：
						</td>
						<td>
							<select name="questiontype" class="input-medium" autocomplete="off">
						  		<option value="0">类型不限</option>
						  		<volist name="questiontype_list" id="vo">
						  			<option <if condition="$questiontype eq $vo['questid']">selected="selected"</if> value="<{$vo.questid}>"><{$vo.questype}></option>
								</volist>			
						  	  </select>
						</td>
						<td>
							难度：
						</td>
						<td>
							<select name="questionlevel" class="input-medium" autocomplete="off">
						  		<option value="0">难度不限</option>
								<volist name="questionlevel" id="vo">
						  			<option <if condition="$squestionlevel eq $key">selected="selected"</if> value="<{$key}>"><{$vo}></option>
								</volist>	
					  		</select>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<button class="btn btn-primary" type="submit" autocomplete="off">搜索</button>
							<a href="<{:U('Questions/addquestion',array('type'=>$type))}>" class="btn btn-primary" autocomplete="off">添加</a>
							<a href="<{:U('Questions/import_question')}>" class="btn btn-primary" autocomplete="off">导入</a>
							<input type="hidden" value="1" name="search[argsmodel]" autocomplete="off">
						</td>
						<td colspan="4"></td>
					</tr>
				</tbody></table>
			</form>
<if condition="$piddata">			
<div style=" padding-bottom:10px;"><a href="<{:U('Questions/addquestion',array('type'=>$type,'questionparent'=>$pid))}>" class="btn btn-default"> <i class="fa fa-plus"></i>  添加子题</a></div>
</if>	
	<div class="bootstrap-table">
		<div class="fixed-table-container" style="padding-bottom: 0px;"> 
			<div class="fixed-table-body"> 
				<table id="data-table" class="table"><thead>
			<tr>
			 
			<th style="" data-field="id"><div class="th-inner sortable both desc">ID</div><div class="fht-cell"></div></th>
			<if condition="$type eq 1">
			<th style="" data-field="name"><div class="th-inner ">试题类型</div><div class="fht-cell"></div></th>
			</if>
			<th style="" data-field="name"><div class="th-inner ">试题内容</div><div class="fht-cell"></div></th>
			<th style="" data-field="created_at"><div class="th-inner ">录入人</div><div class="fht-cell"></div></th>
			<th style="" data-field="created_at"><div class="th-inner ">添加时间</div><div class="fht-cell"></div></th>
			<th style="" data-field="created_at"><div class="th-inner ">难度</div><div class="fht-cell"></div></th>
			<th style="" data-field="id"><div class="th-inner ">操作</div><div class="fht-cell"></div></th>
			</tr></thead>
			<tbody>
			<volist name="data" id="vo">
			<tr>
			<td style=""><{$vo.questionid}></td>
			<if condition="$type eq 1">
				<td style=""><{$vo['questype']['questype']}></td>
			</if>
			<td style=" width:400px"><a title="查看试题" class="selfmodal" href="javascript:;" url="<{:U('Questions/questions_detail',array('questionid'=>$vo['questionid']))}>" data-target="#modal"> 
			
			<{:cutstr($vo['question'],70)}>
			
			</a></td>
			<td style=""><{$vo.questionusername}></td>
			<td style=""><{$vo.add_time}></td>
			<td style=" text-align:center"><{$questionlevel[$vo['questionlevel']]}></td>
			<td style="">
			<!--2为冒题-->
			<if condition="$type eq 2 and $vo['questionparent'] eq 0">
			<!--<a href="<{:U('Questions/addquestion',array('type'=>2,'pid'=>$vo['questionid']))}>" class="btn btn-primary btn-xs">添加子题</a>&nbsp;&nbsp;-->
			<a href="<{:U('Questions/index',array('type'=>2,'pid'=>$vo['questionid']))}>" class="btn btn-primary btn-xs">查看子题</a>&nbsp;&nbsp;
			</if>
			<a href="<{:U('Questions/addquestion',array('type'=>$vo['type'],'questionid'=>$vo['questionid']))}>" class="btn btn-primary btn-xs">编辑</a>&nbsp;&nbsp;
			 
			
			<!--<a href="<{:U('Questions/status_question',array('questionid'=>$vo['questionid']))}>" class="btn btn-primary btn-xs delete-this"><{$vo['questionstatus']==1?"禁用":"启用"}></a>-->
			&nbsp;&nbsp;<a onclick="return confirm('确认删除？')"  href="<{:U('Questions/del_question',array('questionid'=>$vo['questionid']))}>" class="btn btn-primary btn-xs delete-this">删除</a>
			
			 
			</td>
			</tr>
			</volist>
			</tbody></table>
			 </div> 
			  <include file="./Apps/BoxAdmin/View/Ace/Public/pager.html" />
		</div>
	    </div>
			
	        
		</div>
        </div>
    </div>
   

        </div>
		
		 
		 
		 



  <!-- Modal -->
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">查看问题</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
         
      </div>
    </div>
  </div>
</div>
     
<script type="text/javascript">
$(function(){
	 /********选中章节****/
	 <if condition="$questionsubjectid">
		 $.get("/Subject/get_ajax_section/type/_sel?subjectid=<{$questionsubjectid}>&questionsectionid=<{$questionsectionid}>",function(data){
			$("#sectionselect").html(data);
		 })
	 </if>
	 /********知识点****/
	  <if condition="$questionknowsid">
		 $.get("/Subject/get_ajax_knows/type/_sel?sectionid=<{$questionsectionid}>&questionknowsid=<{$questionknowsid}>",function(data){
			$("#knowsselect").html(data);
		 })
	 </if>
})
</script>

 
